package cn.software.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

/**
 * 学生考试关联表
 * @TableName stu_test
 */
@TableName(value ="stu_test")
public class StuTest implements Serializable {
    /**
     * 学生考试id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 学生id
     */
    private Integer userId;

    /**
     * 考试id
     */
    private Integer testId;

    /**
     * 学生在该场考试的得分
     */
    private Integer score;

    /**
     * 试卷状态：0:试卷未批阅 1：待批阅 2：已批阅
     */
    private Integer status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 学生考试id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 学生考试id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 学生id
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 学生id
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 考试id
     */
    public Integer getTestId() {
        return testId;
    }

    /**
     * 考试id
     */
    public void setTestId(Integer testId) {
        this.testId = testId;
    }

    /**
     * 学生在该场考试的得分
     */
    public Integer getScore() {
        return score;
    }

    /**
     * 学生在该场考试的得分
     */
    public void setScore(Integer score) {
        this.score = score;
    }

    /**
     * 试卷状态：0:试卷未批阅 1：待批阅 2：已批阅
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 试卷状态：0:试卷未批阅 1：待批阅 2：已批阅
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StuTest other = (StuTest) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getTestId() == null ? other.getTestId() == null : this.getTestId().equals(other.getTestId()))
            && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getTestId() == null) ? 0 : getTestId().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", testId=").append(testId);
        sb.append(", score=").append(score);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}